download video to from pytube with a special name

39

import os
from pytube import YouTube

yt = YouTube('http://youtube.com/watch?v=9bZkp7q19f0')
yt.streams.first().download()
os.rename(yt.streams.first().default_filename, 'new_filename.ext')`

Comments

Submit
0 Comments